<template>
  <div>
    hello world
    <button @click="toParent">按钮点击</button>
  </div>
</template>

<script>
export default {
  data() {
    return {
      msg: "hello world",
    };
  },
  created() {},
  mounted() {},
  computed: {},

  watch: {},
  methods: {
    myFn() {
      console.log("dddddd");
      return { msg: "1" };
    },
    toParent() {
      this.$emit("toParent", () => this.myFn());
    },
  },
};
</script>

<style>
</style>